using UniversalAdmin.Domain.Entities;

namespace UniversalAdmin.Domain.Repositories;

public interface IRoleRepository : IRepository<Role>
{
    Task<Role?> GetWithPermissionsAsync(Guid id);
    Task<IEnumerable<Permission>> GetPermissionsByRoleAsync(Guid roleId);
    Task<bool> HasPermissionAsync(Guid roleId, string resource, string action);
    Task<IEnumerable<Permission>> GetUserPermissionsAsync(Guid userId);
    Task<bool> UserHasPermissionAsync(Guid userId, string resource, string action);
    Task AssignPermissionsToRoleAsync(Guid roleId, List<Guid> permissionIds);
    Task ClearRolePermissionsAsync(Guid roleId);
    Task<List<Role>> GetRolesByUserAsync(Guid userId);
    Task AssignRolesToUserAsync(Guid userId, List<Guid> roleIds);
}